package org.datacoder.geocoding.datastructures.rectangles

import org.datacoder.geocoding.datastructures.geoshapes.*
import org.datacoder.geocoding.datastructures.util.*

class KDIntervalTreeNode {

    KDIntervalTreeNode left
    KDIntervalTreeNode right
    double center
    int type

    SortedSet<GeoInterval> geoRectanglesByStart
    SortedSet<GeoInterval> geoRectanglesByEnd

    public KDIntervalTreeNode(int type){
        this.type = type
        geoRectanglesByStart = new TreeSet<GeoRectangle>(new GeoRectangleStartPointComparator(type))
        geoRectanglesByEnd = new TreeSet<GeoRectangle>(new GeoRectangleEndPointComparator(type))
    }
    public void addGeoRectangle(GeoRectangle gr){
        geoRectanglesByStart.add(gr)
        geoRectanglesByEnd.add(gr)
    }

}

